package deviceinfo.wsm.com.deviceinfo.hardware;

import java.util.ArrayList;
import java.util.LinkedHashMap;

import deviceinfo.wsm.com.deviceinfo.WsmDeviceInfoSDK;

/**
 * Created by 王家宝 on 2018/7/6.
 * TEL:18241150668
 * MAIL:639586819@qq.com
 */

public class HardwareInfoUtils {

    private static AccelerometerWorker accelerometerWorker;

    public static void InitAccelerometerMoniter(final WsmDeviceInfoSDK.OnHardwareDataBackListener onHardwareDataBackListener) {
        if (accelerometerWorker == null) {
            OnSensorDataBackListener listener = new OnSensorDataBackListener() {
                @Override
                public void onSensorDataBackSuccess(ArrayList<LinkedHashMap> SensorResult, ArrayList<LinkedHashMap> gravitySensorResult, ArrayList<LinkedHashMap> gyroscopeSensorResult) {
                    onHardwareDataBackListener.onSuccess(SensorResult,gravitySensorResult,gyroscopeSensorResult);
                }

                @Override
                public void onSensorDataBackFailed() {
                    onHardwareDataBackListener.onFailed();
                }
            };
            accelerometerWorker = new AccelerometerWorker(listener);
        }
    }



}
